package finalproject.controller.commands;

import finalproject.model.player.Player;
import finalproject.view.StringManager;

/**
 * The light command
 * @author Buisson Kevin
 *
 */
public class LightCommand extends Command {

	/**
	 * 
	 * @param player the player issuing the command
	 * @param args the args of the command
	 */
	public LightCommand(Player player, String[] args)
	{
		super(player, args);
	}

	@Override
	public boolean process()
	{
		// Light already on
		if (getPlayer().getCurrentRoom().isLighted())
		{
			StringManager.outPut("alreadylight");
			return false;
		}

		// Turn light on
		getPlayer().getCurrentRoom().switchLightTo(true);
		StringManager.outPutText(StringManager.getString("lightup") + "\n" + getPlayer().getCurrentRoom().toString());
		return false;
	}
}
